#!/usr/bin/env node

const log = console.log,
      Dog = require('./02-dog.js');

let taidi = new Dog('taidi', 4),
    zangao = new Dog('zangao', 5);
taidi.on('bark', onBark);
zangao.on('bark', onBark);

function onBark(){
  log(`${this.name()} barked! energy: ${this.energy()}`);
}
